package cn.ycl.system.other.study.leetCode;

import java.util.HashMap;

/**
 * @author YT-007
 */
public class Node implements Comparable<Node> {
	/**
	 * 存放数据本身，比如 ‘a’=>97 空格 ‘ ’==>32
	 */
    Byte data;
	/**
	 * 权值，表示字符出现的次数
	 */
	int weight;
	/**
	 * 左树
	 */
    Node left;
	/**
	 * 右树
	 */
	Node right;

    public Node(Byte data, int weight) {
        this.data = data;
        this.weight = weight;
    }

    private void getTemp(){
		System.out.println("");
	}

    @Override
    public String toString() {
        return "Node [data=" + data + ", weight=" + weight + "]";
    }

	/**
	 * 实现comparable接口必须实现的方法
	 * @param o
	 * @return
	 */
	@Override
    public int compareTo(Node o) {
        // 从小到大排序
		HashMap hashMap = new HashMap();

		return this.weight - o.weight;
    }


	/**
	 * 前序遍历
	 */
    public void preOrder() {
        System.out.println(this);
        if (this.left != null) {
            this.left.preOrder();
        }
        if (this.right != null) {
            this.right.preOrder();
        }
    }

	public static void main(String[] args) {
		String idCard = "360724199704286013";
		System.out.println(Integer.parseInt(idCard.substring(16, 17)));
		System.out.println(Integer.parseInt(idCard.substring(16, 17)) % 2 == 0 ? "女" : "男");
	}

}